%!PS

%/show_line {==} def
/y_base 700 def
/x_base 325 def
/line_height 12 def
(Courier) findfont 10 scalefont setfont

/show_line  % array showline
  {
    5 dict begin
    /line exch def
    /width 0 def
    line
      {
        50 string cvs length 1 add
        /width exch width add def
      } forall
    /counter 0 def
    /st_line width string def
    line
      {
        /number exch def
        /token number 50 string cvs def
        st_line counter token putinterval
        /counter token length counter add def
        st_line counter ( ) putinterval
        /counter counter 1 add def
        
      } forall
    0 0 moveto st_line stringwidth pop
    2 div x_base exch sub
    y_base line_height line length mul sub moveto
    st_line show
    end
  } def

/trianguline  % n trianguline array: creates an array containing the nth line of pascal' s triangle 
  {
    5 dict begin
    /n exch def
    n 1 eq 
      {[1]}
      {
        n 1 sub trianguline
        /previous_line exch def
        % create array object for the current line
        previous_line length 1 add array
        /current_line exch def
        
        0 1 current_line length 1 sub
          {
            /i exch def
            % retrieve the i th number from the previous line or 0:
            previous_line length i gt
              {previous_line i get}
              {0}
            ifelse
            i 1 ge
              {previous_line i 1 sub get}
              {0}
            ifelse
            add
            current_line exch i exch
            put
          } for
        current_line
      } ifelse
    % print the line:
    dup show_line
    end
  } def

30 trianguline
showpage